package com.heima.green;


import com.heima.green.config.GreenImageScan;
import com.heima.green.config.GreenTextScan;
import org.springframework.context.annotation.Import;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @author Administrator
 */
@Import({GreenImageScan.class, GreenTextScan.class})
public class AliyunGreenTemplate {

    @Resource
    private GreenTextScan greenTextScan;

    @Resource
    private GreenImageScan greenImageScan;

    /**
     * 文本内容审核
     *
     * @param content
     * @return
     */
    public Map<String, String> greenTextScan(String content) {
        try {
            return greenTextScan.greenTextScan(content);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

    /**
     * 图片内容审核
     *
     * @param imageList
     * @return
     */
    public Map<String, String> greenImageScan(List<byte[]> imageList) {
        try {
            return greenImageScan.imageScan(imageList);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}
